﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Users_Show.aspx.cs" Inherits="FJERP.Users_Show" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>会员列表</title>
</head>
<body>
        <form runat="server">


<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基础信息 <span class="c-gray en">&gt;</span> 会员管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c"> 
		<input name="MemberCard_owner" type="text" runat="server" id="MemberCard_owner" class="input-text" style="width:250px" placeholder="输入持卡人姓名" />
        <input name="MemberCard_Name" type="text" runat="server" id="MemberCard_Name" class="input-text" style="width:250px" placeholder="输入会员卡号" />
		<button runat="server" onserverclick="Unnamed_ServerClick" type="button" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i>搜索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a href="UsersAdd.html" onclick="admin_add('添加会员','UsersAdd.html','800','500')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加会员</a></span> <span class="r">共有数据：<strong><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></strong> 条</span> </div>

    <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
        <HeaderTemplate>
             <table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="12">会员列表</th>
			</tr>
			<tr class="text-c">
				
				<th>会员编号</th>
				<th>会员卡号</th>
				<th>车主姓名</th>
				<th>车牌号码</th>
				<th>车辆品牌</th>
				<th>会员积分</th>
				<th>储值金额</th>
				<th>会员等级</th>
                <th>会员状态</th>
                <th>会员操作</th>
			</tr>
		</thead>
        </HeaderTemplate>
        <ItemTemplate>
            <tbody>
			<tr class="text-c">
				<td><%#Eval("MemberCard_Id") %></td>
				<td><%#Eval("MemberCard_Name") %></td>
				<td><%#Eval("MemberCard_owner") %></td>
				<td><%#Eval("MemberCard_Cnum") %></td>
				<td><%#Eval("MemberCard_CardID") %></td>
				<td><%#Eval("MemberCard_ingeral") %></td>
				<td><%#Eval("MemberCard_sphere") %></td>
                <td><%#Eval("Rank_Name") %></td>
                <td>
                    <a class='label label-success radius' style='cursor:pointer' OnClick="fun(<%#Eval("MemberCard_Id") %>)"id="MemberCard_State<%#Eval("MemberCard_Id") %>"><%#Convert.ToInt32(Eval("MemberCard_State"))==1?"已启用":"已禁用" %></a>
                 </td>
                <td >
                    <asp:Button ID="Button1" runat="server" Text="修改" CommandName="upt" CommandArgument='<%#Eval("MemberCard_Id") %>' />
                    <asp:Button ID="Button2" runat="server" Text="删除" CommandName="del" CommandArgument='<%#Eval("MemberCard_Id") %>' OnClientClick="retrn confirm('确认删除吗???')"/>
                </td>
			</tr>
			
		</tbody>
            </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    
    </asp:Repeater>

    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"></webdiyer:AspNetPager>

        
</div>
 <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/H-ui.js"></script>
    <script type="text/javascript" src="js/H-ui.admin.js"></script>
<script type="text/javascript">
/*
	参数解释：
	title	标题
	url		请求的url
	id		需要操作的数据id
	w		弹出层宽度（缺省调默认值）
	h		弹出层高度（缺省调默认值）
*/
/*管理员-增加*/
function admin_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*管理员-删除*/
function admin_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		//此处请求后台程序，下方是成功后的前台处理……
		
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
/*管理员-编辑*/
function admin_edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*管理员-停用*/
function admin_stop(obj,id){
	layer.confirm('确认要停用吗？',function(index){
		//此处请求后台程序，下方是成功后的前台处理……
		
		$(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_start(this,id)" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">已禁用</span>');
		$(obj).remove();
		layer.msg('已停用!',{icon: 5,time:1000});
	});
}

/*管理员-启用*/
function admin_start(obj,id){
	layer.confirm('确认要启用吗？',function(index){
		//此处请求后台程序，下方是成功后的前台处理……
		
		
		$(obj).parents("tr").find(".td-manage").prepend('<a onClick="admin_stop(this,id)" href="javascript:;" title="停用" style="text-decoration:none"><i class="Hui-iconfont">&#xe631;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
		$(obj).remove();
		layer.msg('已启用!', {icon: 6,time:1000});
	});
}
function fun(id)
{
   
    var sr = $("#MemberCard_State" + id + "").html() == "已启用" ? 0 : 1;
  
    $.ajax({
        type: "post",
        url: "Handler/HanderUpt.ashx",
        data: {

            MemberCard_State: sr,
            MemberCard_Id:id
        },
        success: function (data) {
            if (data == "1" && sr=="1")
            {
                alert("已启用");
                $("#MemberCard_State" + id + "").html("已启用")
            }
            else
            {
                alert("已禁用");
                $("#MemberCard_State" + id + "").html("已禁用")
            }

        }
    })
}
</script>
</form>

<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
    {"appName":"Firefox","requestId":"30f076efbe8240d294a0f748fd521ed4"}
</script>
<script type="text/javascript" src="http://localhost:2071/85d61c9896f5474584460e6a43ddc93f/browserLink" async="async"></script>
<!-- End Browser Link -->

</body>
</html>
